package org.jeecg.modules.platform.api;


import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.ServiceNameConstants;
import org.jeecg.modules.platform.entity.CyPlatformOrganizationInfo;
import org.jeecg.modules.platform.fallback.PlatformOrganizationMemberFallback;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component
@FeignClient(contextId = "SysPlatformOrgMemberApi", value = ServiceNameConstants.SERVICE_SYSTEM, path = ServiceNameConstants.PATH_MEMBER, fallback = PlatformOrganizationMemberFallback.class)
@ConditionalOnMissingClass("org.jeecg.modules.platform.member.controller.CyPlatformOrganizationAndMemberController")
public interface PlatformOrganizationMemberApi {

    @GetMapping("listOrg")
    @ApiOperation(value = "获取当前用户关联组织")
    public Result<List<CyPlatformOrganizationInfo>> listOrg(@RequestParam(name = "userId",required = false) String userId);

    @GetMapping("checkAdmin")
    @ApiOperation(value = "查询是否管理员")
    public Result<Boolean> checkAdmin(@RequestParam(name = "userId",required = false) String userId, @RequestParam(name = "orgId",required = false) String orgId);


}
